<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>按广告类型查询</title>
    <link rel="stylesheet" type="text/css" href="${pageContext.servletContext.contextPath}/st/back/css/base.css">
    <link rel="stylesheet" type="text/css" href="${pageContext.servletContext.contextPath}/st/back/css/iconfont.css">
    <script type="text/javascript" src="${pageContext.servletContext.contextPath}/st/front/JS/jquery-3.2.1.min.js"></script>
    <link rel="stylesheet" type="text/css" href="${pageContext.servletContext.contextPath}/st/back/layui/css/layui.css">
    <script type="text/javascript" src="${pageContext.servletContext.contextPath}/st/back/layui/layui.js"></script>
    <!-- 滚动条插件 -->
    <link rel="stylesheet" type="text/css" href="${pageContext.servletContext.contextPath}/st/back/css/jquery.mCustomScrollbar.css">
</head>

<body>
<div class="cBody">
    <div class="console">
        <form class="layui-form" action="${pageContext.servletContext.contextPath}/getAdvlx" method="get">
            <div class="layui-form-item">
                <div class="layui-input-inline">
                    <select name="lx">
                        <option value="0">请选择</option>
                        <option value="1">轮播图广告</option>
                        <option value="2">轮播图底部广告</option>
                        <option value="3">首页模块顶部广告</option>
                        <option value="4">首页模块广告</option>
                    </select>
                </div>
                <button class="layui-btn" lay-submit lay-filter="formDemo">查询</button>
            </div>
        </form>

        <script>
            layui.use('form', function () {
                var form = layui.form;

                //监听提交
                form.on('submit(formDemo)', function (data) {
                    layer.msg(JSON.stringify(data.field));
                    return true;
                });
            });
        </script>
    </div>
    <table class="layui-table">
        <thead>
        <tr>
            <th>广告商品名称</th>
            <th>广告图片</th>
            <th>广告等级</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <c:forEach items="${page.list}" var="adv">
            <tr>
                <td>${adv.comname}</td>
                <td>
                    <img src="${pageContext.servletContext.contextPath}/images/${adv.apath}"
                         width="70" height="30" onmouseenter="imgBig(this)" onmouseleave="imgSmall(this)"/>
                </td>
                <td>
                    <c:if test="${adv.type_id==1}">
                        轮播图广告
                    </c:if>
                    <c:if test="${adv.type_id==2}">
                        轮播图底部广告
                    </c:if>
                    <c:if test="${adv.type_id==3}">
                        首页模块顶部广告
                    </c:if>
                    <c:if test="${adv.type_id==4}">
                        首页模块广告
                    </c:if>
                </td>
                <td>
                    <a class="layui-btn layui-btn-xs" href="${pageContext.servletContext.contextPath}/UpAdver/${adv.aid}">修改广告</a>
                </td>

            </tr>
        </c:forEach>

        </tbody>
    </table>
    <!--分页-->
    <!-- layUI 分页模块 -->
    <div id="pages" style="text-align: center">
        <!--显示页数-->
        <c:forEach var="pageNo" items="${page.navigatepageNums}">
            <c:choose>
                <c:when test="${pageNo == page.pageNum}">
                    <span class="numbers current" data-v-0acc30d3="">${pageNo}</span>
                </c:when>
                <c:otherwise>
                    <a class="numbers" data-v-0acc30d3="" href="${pageContext.servletContext.contextPath}/getAdvlx?currentPageNo=${pageNo}&lx=${lx}" stat_exposure="true">${pageNo}</a>
                </c:otherwise>
            </c:choose>
        </c:forEach>
    </div>
</div>
</body>
</html>
